<template>
  <div style="overflow-y: auto">
    <FormArea v-model:formDetail="form" v-model:id="form.id" :marginTop="'0px'" @success="saveSuccess" />
    <FormForest v-model:formDetail="form" v-model:id="form.id" :marginTop="'10px'" @success="saveSuccess" />
    <formSpecies v-model:formDetail="form" v-model:id="form.id" :marginTop="'10px'" @success="saveSuccess" />
    <FormPlant v-model:formDetail="form" v-model:id="form.id" :marginTop="'10px'" @success="saveSuccess" />
    <FormAnimal v-model:formDetail="form" v-model:id="form.id" :marginTop="'10px'" @success="saveSuccess" />
    <FormSystemService v-model:formDetail="form" v-model:id="form.id" :marginTop="'10px'" @success="saveSuccess" />
  </div>
</template>

<script setup lang="ts" name="ZLSummarizeData">
import { onMounted, ref } from 'vue'
import { TbySummarizeData, getSummarizeDataDetail } from '@api/tby/summarize/data/summarizeData'
import FormArea from './form-area.vue'
import FormForest from './form-forest.vue'
import formSpecies from './form-species.vue'
import FormPlant from './form-plant.vue'
import FormAnimal from './form-animal.vue'
import FormSystemService from './form-system-service.vue'

const form = ref<Partial<TbySummarizeData.Form>>({})

const saveSuccess = (id: number) => {
  form.value.id = id
}

onMounted(() => {
  getSummarizeDataDetail().then(({ data }) => {
    form.value = data
  })
})
</script>

<style scoped lang="scss">
.card-header {
  height: 25px;
  line-height: 25px;
  .left {
    float: left;
    .icon {
      width: 5px;
      background-color: #104cf0;
      float: left;
    }
    .title {
      float: left;
      margin-left: 5px;
      font-weight: bold;
    }
  }
  .right {
    float: right;
  }
}
.mo-input--number {
  border: 1px solid #dcdfe6;
  display: flex;
  border-radius: 4px;
  .el-input-number--mini {
    flex: 1;
  }
  ::v-deep .el-input__inner {
    border: none !important;
  }
}
.define-append {
  width: 40px;
  display: inline-block;
  background: #f5f7fa;
  padding: 0px 3px;
  border-left: none;
  height: 32px;
  line-height: 32px;
  color: #909399;
  font-size: 12px;
  text-align: center;
}
</style>
